Changed the architecture to simplify usage, and prevent some potential misuse. Added the first of the unit tests.