add amd support

based on amdjs/backbone