More pin mode fixes

- Fix analog event handler which was not respecting 0-1023 values for analog in
- Make pin.save accept -1 as a mode, and remove function and disable pin if sent