First stage
Second stage
Third stage
Merge pull request #20 from jwkoelewijn/compile_refactor

Looks great! Well done, will be merged now! btw, sorry about for not seeing it sooner