Cleaned up the javascript for calendar through use of resource modules.