Javascript module for creating properties on  a javascript object and invoking the property as a function