Extend JavaScript promises with synchronous transactions