Re-organise modules
Move tests into source files