Register for AMD and prevent global variables when unnecessary

Avoid global variable when using css-modal with an AMD loader.