File reorganization and setup.py installation

Major code structure changes by Luuk Visser.