Set up javascript using modular patterns