Update library to use RequireJS and AMDClean for smaller build files.