Modifications to split code into modules for use with mitsuhiko's Makefile