A custom implementation of JavaScript promise specification.