Fixed circular dep

I have read that browserify can have issues with circular dependencies and I think the changes I have made here should resolve the issues I have experienced with #129.

The tests still all pass with these changes, the code can be compiled with browserify without any issues, and mocha tests for code that includes this library run without issues too.

These are mostly structure changes that prevent a file1 requires file2 and file2 requires file1 situations and I tried to following the coding standards that I saw.  Please let me know if there is anything that I need to fix.