Introduce factory for creating data objects

The constructors of all data object implementations are
package private now, so users can only create them with
the factory. The factory can implement canonization and
other magic later on if needed.