Added adapter mechanism to make possible to support more js libs(eg. Angular's $http).