changed this to work using the module pattern, and fixed a bug when a defined setter already exists