Require js modular pattern + cleanup