added cmake-based build system and reorganized