Seperate core to namespaces.

Really should have been done like this at the start.