Restructure files and cleanup

Bunch of small changes, please review @martijnbastiaan .