The element-resolving functions on the Promise constructor are all very similar. To prepare for more of these functions to be implemented, break out common parts into a base class.