comparator: Extracted BaseComparator class

This can be used for the Raster class, that does not support most of the
common operators (yet).
types: Added comparator_factory attribute to the Raster type

This enables the use of the GenericFunctions in select queries. Previously
those functions could only be used on fetched instances of the column,
but not as part of queries yet.
comparator: Moved common operators to the BaseComparator
doc/spatial_operators: Removed undocumented attributes

We don't need to document that the classes have a __module__ attribute
test_types: Added more tests to TestRaster