Modify GPIO register logic to make it more compact and easier to follow

1) Tried to remove register write functions where possible and move the logic
   into the main write function.
2) Rewrote reset to not use the register write functions.  Instead, it
   updates the register variables directly and directly resets any
   derived state variables.  I think this is closer to how real hardware
   works, and is less error-prone.
3) Some other general cleanup to reduce clutter.
Clean old comment
Remove custom bit manipulation macros

I removed the macros in preparation for submitting the changes upstream.
Although I liked the macros, I thought it would be better to either use
the provided macros/functions in bitops.h or directly use bit-wise or's
and and's (as is customary in QEMU source code).
Make read-only and write-only register errors into logged warnings
In work.
More changes.
Further changes.