Reimplemented do-fields as a function
Fixed leaky abstraction in where
Added validation to prevent duplicate CDs. Addresses #4