opaswd uses ctypes instead of custom C stubs

This is a manual rebase of a previous pull request (#1) which had grown too big to review. I've basically squashed all of those changes into four commits, and kept the version bump (I'll push a tag once this gets pulled).