Add types.hh with basic precise type definitions.
Allow zero-length slices.
Implement error and add abort_error/generic_error_code.