Moved 'private' methods from State.prototype to regular functions

Prevents users of the library from seeing the private methods