Improved caching. Fixed bugs with hasMany/belongsTo relationship wiring.