Major refactor to prototype based methods

Allows creation of separate instances allowing consistency across
multiple files (or code snippets)