Converted the bluebird definitions to generics

A rebased version that closes #1799

Closes  #1563 too (at last)