Isolate field reading logic into read_field()

Add context structures for decrypting the database to add in
refactoring.