Remove any definitions that remain in header files

Improve build automation by separating declarations from definitions
and using forward declarations in place of include directives
wherever possible.  Also by creating a namespace and separate source
file for the analysis routines (previously in main.cpp).

closes issue #1