Port jmdobry/angular-data#208 and jmdobry/angular-data#225.

Stable Version 1.0.0-alpha.4-0.