Changed indexing and writebacks

Indexes are now integers instead of string, a 'writeback' parameter is now stored in the db dictionary. Some doc strings added, read_data updated.