Support AMD

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