Clean up effort

Moved a couple of fat function definitions from header to source files.
Explicitly enforced the const-ness in a couple of function definitions.