Support AMD

Added an export module, because the original state-machine.js supports AMD, which feature was not available from TypeScript before this patch.
improved bluebird definitions

changed part of module to static class members
- enables Promise.try()
various small fixes and tweaks
fix bootstrap.datepicker type

Param `startDate` and `endDate` are not only Date type.
Merge pull request #1860 from fancyoung/master

fix bootstrap.datepicker type
Merge pull request #1772 from balassy/patch-2

Support AMD
jQuery:Lets see if we can be JSDoc complete by v1
jQuery: JSDoc get's closer
jQuery: coming on
jQuery: are we there yet?
Merge pull request #1864 from johnnyreilly/master

jQuery:Lets see if we can be JSDoc complete by v1
jQuery: Promises promises
Merge pull request #1856 from Bartvds/def/bluebird

restructured bluebird definitions
jQuery: As promised
Merge pull request #1865 from johnnyreilly/master

jQuery: Promises promises