Some reworking to incorporate requirejs