added Q promises library...

... and replaced jQuery promises