Requirejs

Define all modules as AMD definitions. Also add Docs as test environment for this changes.