Adding some frontend stuff with jQuery promises/deferred