Migrate to modular code

This pull-request closes #2 - And makes the code modular at the same time.