Added a module system with a dependancy resolver.
This is based on the work I've done a long, long time ago.