adding an amd functionality - a la underscore.js style