Tests failed in Chrome. Fixed.

Tests failed in Chrome due to an incompatibility between Promises/A+ and
indexedDB specifications. Worked around by slightly change the Promise
implementaion to not use setImmediate()
Tests failed in Chrome. Fixed.