GPIO improvements

Now supports the metalbox hardware. Much improved GPIO handling, but
requires latest RPi.GPIO library.