Use AMD

This uses `require.js` to structure the library.