Update gen_db.py to use the new API.
Basic Attribute/AttributeValue creation/retrieval.

Working towards replacing measurand and source with data defined
attributes. Still need to attach attributes to TimeseriesInstances.