Added possibility to use calendar as an AMD module.