[Assets] Made the AssetManager uses promises (borrowed from when.js) instead of callbacks.