created namespaces for library
Changed factory functions to static.
misc changes