Some cleanup code, added cmake file