Rename read/write functions to read_db/write_db

This more closely reflects what they're really doing and paves the way
for other functions which read inputs, outputs, flags, ...
Add function to read the state of outputs

Note that this is untested code. The PLC does not return an error, but
it's not yet confirmed that the return value is correct.
Add function to read merkers

Note that this is untested code. The PLC does not return an error, but
it's not yet confirmed that the return value is correct. In fact,
indications are that the code does not work.
Simplify read_flag call

Remove the 'db' argument for the read_flag method. It's not at all clear
what the 'db' field is used for when reading flags. Just keep it set to
0 for now.
Merker writing functionality