AMD migration

This pull request introduces AMD pattern to Oasis with a set of common modules taken from Mobile code and unit tests,