Lots of changes as per IRC

I moved the source files to proper directories, made a nice CMake project and fixed SCons.