Have a single function to turn a relay number in the corresponding bit.
Removes some code duplication, and addresses bug where ValueError was
not raised for small negative numbers, which are perfectly valid index
arrays in python.
Use relay numbers from 1 to 4 instead of 0 to 3. The main reason is that
the mod-io board has numbers printed next to each relay, that go from 1
to 4.