Cleaned up some batchprocessor error handling.
Added functionality to TypedObject.swap_typeclass to handle various typeclasses safely. Resolves #390.