First pass at turning code into a stand alone package.  Code examples do not yet all compile.