Made AMD compatible for easier use with require.js