Remove public Value protocol methods

There was originally the promise of serializing/deserializing your own
types, but without a way to set up the expectation on both sides of the
exchange this approach was naive. We can revisit this using
Expression<T> in the future, but we need more directly applicable
functions.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Kill underused typealias, Values

This was more useful before the introduction of Expression.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add custom datatype support

This will be more helpful when proper BLOB support is available (for
easy serialization/deserialization of binary data (images, etc.), but in
the meantime it allows you to support dates flexibly.

E.g., an NSDate TEXT column:

    extension NSDate: Value {
        public typealias Datatype = String
        public class var declaredDatatype: String {
            return Datatype.declaredDatatype
        }
        public class func fromDatatypeValue(datatypeValue: Datatype) -> NSDate {
            return formatter.dateFromString(datatypeValue)!
        }
        public var datatypeValue: Datatype {
            return formatter.stringFromDate(self)
        }
    }

Or, an NSDate INTEGER column:

    extension NSDate: Value {
        public typealias Datatype = Int
        public class var declaredDatatype: String {
            return Datatype.declaredDatatype // or "DATETIME"
        }
        public class func fromDatatypeValue(datatypeValue: Datatype) -> NSDate {
            return self(timeIntervalSince1970: NSTimeInterval(datatypeValue))
        }
        public var datatypeValue: Datatype {
            return Datatype(timeIntervalSince1970)
        }
    }

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Perform internal database operations in FIFO queue

This breaks our embargo with Foundation, but our application had been
suffering as a result.

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

Via a new struct, Blob. Blob, like NSData, exposes `bytes` and `length`
(and actually uses NSData under the hood, for the sake of memory
management).

Without any extensions, you can use Blob's public interface, though it's
slightly verbose:

    let data = UIImagePNGRepresentation(image)
    let blob = Blob(bytes: data.bytes, length: data.length)
    users.insert(avatar <- blob)

Simple extension simplifies:

    extension Blob {
        init(_ data: NSData) {
            self.init(bytes: data.bytes, length: data.length)
        }
        public var data -> NSData {
            return NSData(bytes: bytes, length: length)
        }
    }

    users.insert(avatar <- Blob(UIImagePNGRepresentation(image)))
    // INSERT INTO users (avatar) VALUES (x'...')

You can, of course, extend further to suit your needs:

    extension Blob {
        init(_ image: UIImage) {
            self.init(UIImagePNGRepresentation(image))
        }
        public var image -> UIImage {
            return UIImage(data: data)
        }
    }

    users.insert(avatar <- Blob(image))
    // INSERT INTO users (avatar) VALUES (x'...')

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Enforce Equatable/Comparable datatypes in expressions

This prevents BLOB columns from being compared (though they can be
equated). If someone has a valid reason for extending Blob to be
Comparable, I'm all ears. In the meantime, it seems like an accident
waiting to happen.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Document loss of purity

At least the dependencies on Foundation are implementation details that
can be swapped out at any time.

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

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Add simple aggregation example

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
Make sure NSData is private (for now)

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