Added support for loading as AMD module

Allows usage with AMD frameworks like Require.js. In case that AMD loader is not present behavior is the same as before. In case that AMD loader is present library now requires "knockout" dependency and passes object as factory.