Cleaned up code.
Added header files for constants and globals.

Added
-----
* New header file consts.h defines constants used by CEM.
* New header file globals.h declares and defines global variables used
  by CEM.
Moved constants and globals into header files.