Added namespace and constructors to main.js