Add a standalone irnetproxy.py script for the RedRat irNetBox III

The irNetBox only allows one network connection at a time.  This means
the 16 ir ports it has cannot be easily controlled by multiple clients
simultaneously.

This script allows many clients to connect to the device, and use
the ports concurrently.  **Note**, this only makes sense for the
Asynchronous IO Output Commands, other commands will be run
synchronously as before.

http://www.redrat.co.uk/products/IRNetBox_Comms-V3.X.pdf

Usage
-----

```
$ irnetproxy -r <irNetBox address>
```

OR

```
$ irnetproxy --irnetbox-addresss <irNetBox address> \
             --irnetbox-port 10001\
             --listen-port 10001\
             --listen-address 127.0.0.1\
             -vv

> Listening for connections on 127.0.0.1:10001
```

Existing irNetBox network clients should then connect to the proxy
server, rather than the irNetBox.  Everything else should behave the
same.

Features
--------

 - Session multiplexing: irnetproxy dynamically maps Asyncronous
   Sequence IDs on the fly, meaning that multiple clients can use the
   same Sequence ID concurrently, and the irnet box will continue to
   work.  Both the command acknowledgement, and the subsequent Async
   complete message are always routed to the correct client.

 - On/Off management: irnetproxy will silently accept the on and off
   messages (5 and 6).  A standard ACK response is returned to the
   client, but the command is never sent to the device. This allows
   multiple scripts to try to turn off the device while other devices
   use it.  irnetproxy issues the ON command when it connects, and
   issues an OFF command when it is stopped.
Add irnetproxy tests into the existing test runners

 * make check-pylint now runs on irnetproxy and irnetproxy_test
 * make check-nosetests includes the irnetproxy_test module
 * New python dependency 'mock' added to the .tests.yml file

Note, mock is pip installed because the version in the ubuntu
deb repositories is too old (doesn't support return_value= argument)
tests/fake-irnetbox: Log OUTPUT_IR_ASYNC sequence number

This helped me debug an endianness issue fixed in the next commit.
test_irnetbox_proxy: Isolated component test for irnetproxy.py

Using irnetproxy.py in between 2 `stbt run` clients and a fake irnetbox,
the test checks that each client gets the right responses.

Note that tests/fake-irnetbox now returns the sequence number in the
OUTPUT_IR_ASYNC ACK message in little-endian format. This is the
opposite of what the spec† says. This matches the implementation in
irnetproxy.py, which has been tested against 2 separate irNetBox-III
devices.

† http://www.redrat.co.uk/products/IRNetBox_Comms-V3.X.pdf
irnetproxy_test.py: Remove tests that require `mock` library

Because the library has to be pip-installed (see 10909cc9) which is yet
another dependency for people to install, and all our other dependencies
can be installed with the system package manager (yum, apt-get, etc).

Instead, I added some component tests in the previous commit.
Makefile: Cleanup: Rearrange order of files in `check-pylint` recipe

This keeps the `irnet*` files together, and the `stbt-*` files together,
and the `extra/` files together.
irnetbox.py: Cleanup documentation formatting

I'm going to add another paragraph to the `IRNetBox` class's
documentation in a future commit, so this will make it clearer
where one class's documentation ends and the next begins.

The indentation is reStructuredText's format for definition lists.
irnetbox.py docstring: Mention the irNetBox proxy
irnetproxy.py: Cleanup help message

The output of `./irnetproxy.py --help` used to be:

    usage: irnetproxy.py [-h] [-i LISTEN_ADDRESS] [-p LISTEN_PORT] -r
                         IRNET_ADDRESS [--irnetbox-port IRNET_PORT] [-v]

    A network proxy for RedRat irNetBox MK-III infra-red blaster modules.
    Based on the protocol document:
    http://www.redrat.co.uk/products/IRNetBox_Comms-V3.X.pdf This script
    allows many clients to connect to the device, and use the ports
    concurrently. **Note**, this only makes sense for the Asynchronous IO
    Output Commands, other commands will be run synchronously. Usage -----
    ``` $ irnetproxy -r <irNetBox address> ``` OR ``` $ irnetproxy
    [...]
irnetproxy.py: Cleanup: Remove unnecessary argparse `dest` arguments

http://docs.python.org/2.7/library/argparse.html#dest says:

> ArgumentParser generates the value of dest by taking the first long
> option string and stripping away the initial `--` string. Any internal
> `-` characters will be converted to `_` characters.
irnetproxy.py: Change "--verbosity" command-line argument to "--verbose"

And document the effect of specifying it twice.

The new name is consistent with other command-line utilities.
"--verbosity" should only be used for a flag that takes an argument,
like "--verbosity=2". For example see "nosetests --help".
irnetproxy.py: Mandatory arguments are positional, not flags

This follows the pattern of common tools like telnet, netcat, ssh:

    telnet host [port]
    nc hostname port
    ssh [-p port] [user@]hostname

I renamed "irnetbox-address" to "irnetbox_address" ("-" to "_") for
consistency with "LISTEN_ADDRESS" and "LISTEN_PORT" in argparse's
"--help" output:

    usage: irnetproxy.py [-h] [-v] [-l LISTEN_ADDRESS] [-p LISTEN_PORT]
                         irnetbox_address [irnetbox_port]
irnetproxy.py: "--listen-address" is "-l", not "-i"

Similarity with common command-line tools:

netcat uses "-l" to mean "listen" (though netcat's "-l" doesn't take an
argument; there's a separate, non-optional, positional "hostname"
argument).

telnet uses "-s" to specify a source address, but that is something
different that an address that a server binds to.

varnish, an http proxy, uses "-a address[:port]". I assume that "a"
stands for "address"; that's fine for varnish which only needs to
specify one address, but our irnetproxy needs to specify two addresses,
the address to listen on and the address of the real irNetBox. So I've
chosen "-l" as it's more explicitly the *listen* address.
irnetproxy.py: Cleanup: Consistent order of argparse parameters
README: Document how to specify the TCP port for irNetBox control

This was introduced in commit 9a4d2086, but it wasn't documented because
it was only used by the self-tests. Now it is useful to users of the
irnetbox proxy script from commit fff9f3e6.
Rename irnetproxy.py to irnetbox-proxy

To include the full name of the irNetBox in the program's name, and
removing the `.py` extension for consistency with our other executable
utilities (stbt-run, etc).

The only changes to the file apart from renaming it, are: (use the `-M`
option to `git diff` or `git log` to see just what has changed)

* renaming instances of "irnetproxy.py" inside the file itself (in
  docstrings).
* Adding a magic comment (on line 2) so that Emacs knows that this is
  a python file.

Note that irnetproxy_test.py can't use `import` to import a file without
a `.py` extension, so we have to use `imp.load_source`.

A note on the change to `.gitignore`: Importing irnetbox-proxy (as
opposed to running it from the command line) leaves behind a python
byte-compiled file with the `c` suffix. This normally results in a
`.pyc` extension, but since `irnetbox-proxy` doesn't end in `.py`,
the result is `irnetbox-proxyc`.
Move irnetproxy_test.py to tests/
Merge branch 'irnetbox-proxy'

The RedRat irNetBox network-controlled infrared emitter only allows one
TCP connection at a time. This means that its 16 IR outputs can't be
easily controlled by multiple clients simultaneously.

This commit adds a `irnetbox-proxy` program that accepts multiple client
connections, and forwards the client requests on to the real irNetBox
over a single connection.

Thanks to Steve Stagg for the implementation.

Note that irnetbox-proxy isn't installed by `make install` or the
stb-tester Fedora rpm. In future we might want this installed as
`stbt irnetbox-proxy` or similar.

* irnetbox-proxy:
  Move irnetproxy_test.py to tests/
  Rename irnetproxy.py to irnetbox-proxy
  README: Document how to specify the TCP port for irNetBox control
  irnetproxy.py: Cleanup: Consistent order of argparse parameters
  irnetproxy.py: "--listen-address" is "-l", not "-i"
  irnetproxy.py: Mandatory arguments are positional, not flags
  irnetproxy.py: Change "--verbosity" command-line argument to "--verbose"
  irnetproxy.py: Cleanup: Remove unnecessary argparse `dest` arguments
  irnetproxy.py: Cleanup help message
  irnetbox.py docstring: Mention the irNetBox proxy
  irnetbox.py: Cleanup documentation formatting
  Makefile: Cleanup: Rearrange order of files in `check-pylint` recipe
  irnetproxy_test.py: Remove tests that require `mock` library
  test_irnetbox_proxy: Isolated component test for irnetproxy.py
  tests/fake-irnetbox: Log OUTPUT_IR_ASYNC sequence number
  Add irnetproxy tests into the existing test runners
  Add a standalone irnetproxy.py script for the RedRat irNetBox III