Move rest of interpreter code to interpreter module

This essentially allows us to run the same code via some other environment (ie.
Node) too. This has to be tested still, though.