JavaScript Promise framework