Added cmake build system plus minor changes