A re-write of the CEM code to encourage an object-oriented approach.