added breaks in case statements
initial refactoring

Unit tests pass
more refactoring
abstracted FC_WRITE_AND_READ_REGISTERS
added cast
fixed incorrect parameter
removed duplicate case
renamed types
refactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bitrefactored pdu parsing a bit
added range checks to register counts

The MODBUS spec states that read and write operations must have > 1
register or bit.  This reqirement broke one of the test cases which is
now fixed.
changes callback type sig
added lock and unlock callbacks.

Some Modbus function have both a read and write operation.  The spec
states these operations happen in a transtaction.  The callbacks allow
the implementer to be complient with the transaction requirement.