added AMD modularized version ( requirejs ) to be able to reuse the AI.