Reorganizing project, and adding some bugfixes.