Update pin.read/write bitlash functions and add lastreset function

- Updated pin.read/write/mode functions to more properly represent state
 for the event handlers

- Added "lastreset" bitlash function that will print the last reset
 cause, to help in debugging