various improvements to GPIO support

Don't explicitly set the pin direction, just verify
that it's "in".

Some work on setting the edge (untested).