Move source into src subdirectory
Fix bugs relating to previous commit