Added AMD support using a umdjs pattern