diff --git a/Data/Bson.hs b/Data/Bson.hs
--- a/Data/Bson.hs
+++ b/Data/Bson.hs
@@ -123,7 +123,7 @@
 
 infix 0 :=, =:, =?
 
-data Field = (:=) {label :: !Label, value :: Value}  deriving (Typeable, Eq)
+data Field = (:=) {label :: !Label, value :: Value}  deriving (Typeable, Eq, Ord)
 -- ^ A BSON field is a named value, where the name (label) is a string and the value is a BSON 'Value'
 
 (=:) :: (Val v) => Label -> v -> Field
@@ -164,7 +164,7 @@
 	Int64 Int64 |
 	Stamp MongoStamp |
 	MinMax MinMaxKey
-	deriving (Typeable, Eq)
+	deriving (Typeable, Eq, Ord)
 
 instance Show Value where
 	showsPrec d v = fval (showsPrec d) v
@@ -292,7 +292,7 @@
 	cast' _ = Nothing
 
 instance Val UTCTime where
-	val = UTC . posixSecondsToUTCTime . roundTo (1/1000) . utcTimeToPOSIXSeconds
+	val = UTC
 	cast' (UTC x) = Just x
 	cast' _ = Nothing
 
@@ -378,37 +378,37 @@
 
 -- ** Binary types
 
-newtype Binary = Binary S.ByteString  deriving (Typeable, Show, Read, Eq)
+newtype Binary = Binary S.ByteString  deriving (Typeable, Show, Read, Eq, Ord)
 
-newtype Function = Function S.ByteString  deriving (Typeable, Show, Read, Eq)
+newtype Function = Function S.ByteString  deriving (Typeable, Show, Read, Eq, Ord)
 
-newtype UUID = UUID S.ByteString  deriving (Typeable, Show, Read, Eq)
+newtype UUID = UUID S.ByteString  deriving (Typeable, Show, Read, Eq, Ord)
 
-newtype MD5 = MD5 S.ByteString  deriving (Typeable, Show, Read, Eq)
+newtype MD5 = MD5 S.ByteString  deriving (Typeable, Show, Read, Eq, Ord)
 
-newtype UserDefined = UserDefined S.ByteString  deriving (Typeable, Show, Read, Eq)
+newtype UserDefined = UserDefined S.ByteString  deriving (Typeable, Show, Read, Eq, Ord)
 
 -- ** Regex
 
-data Regex = Regex Text Text  deriving (Typeable, Show, Read, Eq)
+data Regex = Regex Text Text  deriving (Typeable, Show, Read, Eq, Ord)
 -- ^ The first string is the regex pattern, the second is the regex options string. Options are identified by characters, which must be listed in alphabetical order. Valid options are *i* for case insensitive matching, *m* for multiline matching, *x* for verbose mode, *l* to make \\w, \\W, etc. locale dependent, *s* for dotall mode (\".\" matches everything), and *u* to make \\w, \\W, etc. match unicode.
 
 -- ** Javascript
 
-data Javascript = Javascript Document Text deriving (Typeable, Show, Eq)
+data Javascript = Javascript Document Text deriving (Typeable, Show, Eq, Ord)
 -- ^ Javascript code with possibly empty environment mapping variables to values that the code may reference
 
 -- ** Symbol
 
-newtype Symbol = Symbol Text  deriving (Typeable, Show, Read, Eq)
+newtype Symbol = Symbol Text  deriving (Typeable, Show, Read, Eq, Ord)
 
 -- ** MongoStamp
 
-newtype MongoStamp = MongoStamp Int64  deriving (Typeable, Show, Read, Eq)
+newtype MongoStamp = MongoStamp Int64  deriving (Typeable, Show, Read, Eq, Ord)
 
 -- ** MinMax
 
-data MinMaxKey = MinKey | MaxKey  deriving (Typeable, Show, Read, Eq)
+data MinMaxKey = MinKey | MaxKey  deriving (Typeable, Show, Read, Eq, Ord)
 
 -- ** ObjectId
 
diff --git a/bson.cabal b/bson.cabal
--- a/bson.cabal
+++ b/bson.cabal
@@ -1,5 +1,5 @@
 Name:          bson
-Version:       0.2.0
+Version:       0.2.1
 Synopsis:      BSON documents are JSON-like objects with a standard binary
                encoding.
 Description:   A BSON Document is an untyped (dynamically type-checked) record.
@@ -37,3 +37,23 @@
                     Data.Bson.Binary
 
   GHC-prof-options: -auto-all
+
+Test-suite bson-tests
+  Type:             exitcode-stdio-1.0
+  Hs-source-dirs:   tests .
+  Main-is:          Tests.hs
+  Ghc-options:      -Wall -fno-warn-orphans
+
+  Build-depends:      test-framework             >= 0.4 && < 0.7
+                    , test-framework-quickcheck2 >= 0.2 && < 0.3
+                    , QuickCheck                 >= 2.4 && < 2.5
+                    -- Copied from regular dependencies...
+                    , base < 5
+                    , time
+                    , bytestring
+                    , binary
+                    , cryptohash
+                    , data-binary-ieee754
+                    , mtl >= 2
+                    , network
+                    , text == 0.11.*
diff --git a/tests/Tests.hs b/tests/Tests.hs
new file mode 100644
--- /dev/null
+++ b/tests/Tests.hs
@@ -0,0 +1,12 @@
+module Main where
+
+import Test.Framework (defaultMain)
+
+import qualified Data.Bson.Tests
+import qualified Data.Bson.Binary.Tests
+
+main :: IO ()
+main = defaultMain
+    [ Data.Bson.Tests.tests
+    , Data.Bson.Binary.Tests.tests
+    ]
