Change object definitions to not use prototype

Instead, declare functions as properties of the object.