Changed from prototype to an invoked function

Loosely based off of the Revealing Module Pattern, though mostly using
the anonymous function to protect innards from the outside world of
variables.