First step towards modularity

Needs to have clearly stipulated API