AMD migration

This change introduces AMD pattern to Oasis / shared code. For the start a part of shared functionality (sending Nirvana requests) has been ported to AMD (keeping backward compatibility) and unit tests has been added with a nice & simple AMD mocking from Rychu,