Pretty tough, but not impossible.
You could start by reverse engineering (decompiling) the mobi reader booklet, learning how it works, and then writing an epub reader booklet along the same lines. The difficulty lies in the fact that you have to completely understand the API that is internally used (which you can only do by studying the reverse-engineered code). And of course, you have to fully support the epub format, which is by itself not a trivial task, plus you'd want to support some features like font size changes, bookmarks, (ideally) TTS support etc.
As for the download support, I don't know.
I'll stick with calibre converting epubs for me
, but if you want to go for it: good luck!