Remove warnings caused by shadowed 'index' variable

The index variable shadowed a variable in the standard library causing
warnings. Renaming the 'index' variable to 'idx' resolves the issue.
moved error checking to user defined handlers
Merge branch 'shadow-warning' into custom-table-handlers
Move complexity from user handlers to internals

The user handlers required to much knowledge of libmodbus to be
easy to use. They are now reduced to just return the value stored in
a register/bit. this also minimized the interface.