Move most of the library over to Bluebird promises