Decouple ObjectiveRelation from CoreData

Introducing...CoreDataRelation!

(We really ought to start thinking about prefixes as we leave Category
Land.)

At the moment, it works on its own with NSArray. We should consider
supporting NSSet and NSOrderedSet, too, adding categories to them, and
and maybe extracting the idea of ObjectiveRelation completely into a
separate "query-builder" pod, which ObjectiveRecord could depend on and
import just the core it needs.

Moving forward, we could make these interfaces a bit more private, and
we can explore how to better share logic (inheritance feels slightly
heavy-handed, and the fact that ObjectiveRelation has an _objects ivar
that is never utilized down the chain feels...off), but I think it's a
step in the right direction, or a step on the way to the right
direction, at the very least.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Bump CocoaPods

And the SampleProject scheme. Always be blueprinting.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add shortcuts to check if a record has been saved yet

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Improve performance of -[CoreDataRelation count]

If we've already loaded the objects into memory, let's count them,
instead of creating a new fetchRequest and executing a count.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add -[ObjectiveRelation reorder:]

Allows one to override order on a relation.

No analagous class method on NSManagedObject because it doesn't make
sense.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add +[NSManagedObject defaultOrder]

It's an abstract method that can be overridden in subclasses to order
results by default, e.g., by a primary key.

Without it, class methods like reverseOrder, limit:, offset:,
firstObject, lastObject, and find: don't make quite as much sense (or,
at any rate, aren't predictable).

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Reorganize

Makes sense to order things with more relevant methods, per section,
first.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add sectioned/cached fetched results controller method

It feels verbose...so we should change it if we come up with something
more succinct without losing meaning.

We also may want to be smarter with caching by default. Maybe something
as simple as:

  /* ... */ cacheName:[self description]]; /* or with an -MD5, or -hash */

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add batch size to CoreDataRelation

Performance: a thing.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add tests for batch size and fetched results controller

Signed-off-by: Stephen Celis <stephen@stephencelis.com>