Example of building an MVC structure in JavaScript