Reorganise frontend code and build system

We now build each frontend separately for easier testing and
maintainability. In addition, each frontend now has its files split up
for ease of viewing.

Ideally, the emulator core should at some point become a library, loaded
by the frontends. It is the easiest path to go on. I don't feel like
doing this right now, so everything is just built multiple times, sorry!