Rewrote whole library to use namespaces