Changed build type to Program.

Also tried to improve conformance to C++ idioms and added checks against
accidental copying of Spaces and Objects.