Identity map implementation for AngularJS