Finalized refactoring

Moved interfaces to API. Added node types. Added a marshal bundle as
part of this.

Clean up source code

Organized constants