Add initial support for building with scons
Fix some small issues, to get to compile with clang++, remove minor warnings
Fixed some compiler warnings.