.travis.yml: Cleanup: Reorder packages

To the same order as the packages listed in
http://stb-tester.com/getting-started.html#package-names
stbt tv: VirtualBox requires ximagesink

It's not only VMWare but also VirtualBox that cannot display video with
`xvimagesink` and requires `ximagesink`.
.gitignore: Remove obsolete "gst" directory

The "gst" directory doesn't exist since ca4201df.
`make TAGS` rule to create Emacs "TAGS" index file

See:
* http://www.gnu.org/software/emacs/manual/html_node/emacs/Tags.html
* http://www.gnu.org/software/make/manual/html_node/Standard-Targets.html
stbt.Display.teardown: Make debug message less scary-looking

"GLib mainloop is not alive" was the expected, correct behaviour but the
"not alive" part might suggest to someone unfamiliar with stbt internals
that there was a problem. This debug message is intended for debugging
(after the fact) test runs where the recorded video (if the user
specified "stbt run --save-video") is corrupted, possibly because the
GStreamer EOS message wasn't received and thus the GLib mainloop hadn't
terminated.
stbt.frames: Don't deadlock if iterator held twice from user code

If you call `stbt.frames()` while an iterator returned from a previous
call to `stbt.frames()` is still alive, attempting to iterate over the
second iterator would hang indefinitely:

    it1 = stbt.frames()
    for frame, timestamp in it1:
        ...
        break
    it2 = stbt.frames()
    it2.next()  # This deadlocks

The cause was the line `with self.lock in stbt.Display.frames:`.
This lock is intended to stop `stbt.Display.on_new_buffer` from acting
while the user code is processing frames; but it had the unintended
consequence of preventing the user from using 2 different `frames`
iterators.

The solution is to use a re-entrant lock: It can be acquired multiple
times by the same thread (in this case, the main application thread
running the user's script), and is only released once *all* of the
thread's calls to `acquire` have had their corresponding `release`.
Note that `stbt.Display.on_new_buffer` --what this lock is intended to
block-- is a handler for a GStreamer element signal, so it is always
called from the GStreamer element's own thread.

Fixes #36.
README: Remove "Setup tips" section

The immediately previous section links to
http://stb-tester.com/getting-started.html -- no need to duplicate that
information here. The man page (generated from this readme) is supposed
to be a concise reference; the extended help belongs on the website.
extra/vm: Scripts to set up a Virtual Machine with stb-tester installed

This uses "vagrant", a tool for provisioning virtual machines. See
`extra/vm/README.rst` for instructions.

The VM is missing configuration for LIRC, and the RedRat3 doesn't work;
see the "Status" section in `extra/vm/README.rst` for details.
extra/vm: Install 3.5 kernel

The RedRat3 USB infrared emitter doesn't send infrared signals properly
with the redrat3 driver in kernels < 3.3 (the Ubuntu 12.04 stock kernel
is 3.2).

See https://wiki.ubuntu.com/Kernel/LTSEnablementStack for details on
this "linux-generic-lts-quantal" package.
extra/vm/README.rst: Details on what *is* supported, and how to configure lirc
.travis.yml: Install webminspector

For test_that_video_index_is_written_on_eos (see commit b7a37493).
test_that_video_index_is_written_on_eos: Show webminspector output on failure

To debug failures on the travis-ci continuous integration service.
test_that_video_index_is_written_on_eos: Generate longer video file

When the test is run by the Travis continuous integration service, it
was intermittently failing with:

    Traceback (most recent call last):
      File "/home/vagrant/webminspector/webminspector.py", line 116, in <module>
        main()
      File "/home/vagrant/webminspector/webminspector.py", line 97, in main
        pos = segment.SearchLevelOneElements(file_, pos)
      File "/home/vagrant/webminspector/webm.py", line 560, in SearchLevelOneElements
        size, start_pos = ReadOneByteForElementIdSize(file_, pos)
      File "/home/vagrant/webminspector/webm.py", line 53, in ReadOneByteForElementIdSize
        file_.seek(pos)
    TypeError: 'NoneType' object cannot be interpreted as an index
    Didn't find 'Cue Point' in /tmp/stb-tester.zna/webminspector.log

The same error happened when running the test in the Ubuntu VM under
extra/vm, even though the generated video played correctly in Firefox
(and was correctly seekable). Presumably webminspector.py doesn't handle
short videos correctly. After increasing the video's length to 5 seconds
the test now passes reliably.
stbt power: Tool to control networked power switch

Based on a script written by Lewis Haley; I added error checking
and other minor fixes.

This currently supports 2 types of network-controllable power devices:

* IP Power 9258, a family of devices sold under various brand names,
  e.g. http://www.aviosys.com/9258st.html
  (in our experience these devices consistently fail within a year of
  use).

* PDUeX KWX line:
  http://www.pdu-expert.eu/index.php/en/component/k2/itemlist/category/1

I haven't personally tested this against the "IP Power 9258" device
because I don't have the hardware to test against.
stbt power: Check and print new status after switching on/off

The exit status (and the standard output) now reflect whether the
outlet's new status is the same as the status you requested. Before, the
command might fail with no indication that it had failed.

The sleep is necessary because the previous command returns before the
change actually takes effect.
stbt screenshot: Optional `filename` argument

So that users can call `stbt screenshot` with a custom filename to avoid
overwriting previous screenshots.
stbt screenshot: Remove unnecessary `wait_for_motion` and `sleep`

This isn't needed since ac3b7a04.
stbt screenshot: Don't save a video

`stbt screenshot` calls `stbt run`, so if the user had set `save_video`
in their `stbt.conf` file, `stbt screenshot` was saving a (very short)
video to disk.
stbt {screenshot,templatematch,tv}: Cleanup: Remove STBT_LIBEXEC variable

Storing this value in a variable isn't necessary because it is only used
once in each script. The variable name was slightly misleading because
when running `stbt-screenshot` (etc) from the source directory the
variable's value is the source directory, not `$prefix/libexec`; and the
variable capitalisation was inconsistent with the rest of the code.

Note that the purpose of using `dirname "$0"` is so that when we run
`stbt-screenshot` from the unit tests, it runs `stbt-run` (from the
source directory) instead of running the *installed* version of `stbt`.
See f9e59d93.
stbt templatematch: Don't save a video

`stbt templatematch` calls `stbt run`, so if the user had set
`save_video` in their `stbt.conf` file, `stbt templatematch` was saving
a (very short) video to disk.