Restructure as Python package

So that it can be installed using pip and tested with nose. Leaves room for
other vendor plugins under the same namespace.
Change config syntax for services

This is closer to how other plugins look. It makes the `config()` method a
bit easier to read and should be easier to mock.
Add tox to run tests

Install nose and mock, runs tests against Python 2.7
CollectdConfig helper

Cheap mock of collectd's `Config` class. Takes a nested three item tuple.
Can't take a dictionary because nodes can have values *and* children, plus
key names need to not be unique. This is about the simplest thing without
having to write/modify an XML parser.
Patch sys.modules for collectd import

So that we can test the plugin independent of collectd.
Tests for all valid config() options

Using the `CollectdConfig` mock object.
Tests for invalid config() options

Conditions that raise exceptions or warnings.
Fix check for no configured services

This was broken in two ways. It was comparing a dict with an integer, rather
than the number of items in the dict. And it was testing for less than zero,
which is an impossible situation for it to be in.
Restructure tests into class-per-method

So that they are separate and have more concise names, making the file
easier to read.
Tests for scale_and_type()

This has uncovered some potentially undesired behaviour. The `bytes` and
`requests` types are scaled to `INTERVAL`, but by not using a float they are
always rounded down. Commented as FIXME to review later.
Break out datetime.now() for mocking

So that we can predict the return values of `get_time_range()` when testing.
It's not possible to mock stdlib modules/methods.
Tests for get_time_range().
Tests for request()

Test that we construct the right request and handle the response. We don't
handle any errors here -- they are wrapped by `read()`.
Tests for read()

This is closer to an integration test because it's the method that collectd
calls and triggers various internal method calls. As such, we need to mock
quite a lot, to ensure that times are consistent and that it doesn't hit the
network.
Add TravisCI config

Only testing against Python 2.7 at the moment. Will consider 2.6 and 3.x
separately.
Add Python 2.6 to matrix tests

Not adding Python 3.3 because import behaviour has changed:
```
Traceback (most recent call last):
  File "/Users/dcarley/projects/govuk/collectd_cdn_stats/.tox/py33/lib/python3.3/site-packages/nose/case.py", line 382, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/Users/dcarley/projects/govuk/collectd_cdn_stats/.tox/py33/lib/python3.3/site-packages/nose/util.py", line 469, in try_run
    return func()
  File "/Users/dcarley/projects/govuk/collectd_cdn_stats/test/unit/test_fastly.py", line 13, in setup
    from collectd_cdn import fastly
ImportError: cannot import name fastly
```
Reset self.services when calling config()

I'm not sure what the semantics of collectd are -- whether a config load
always coincides with reinstantiating the plugin, or whether `config()` can
be called twice against the same object.

Nevertheless, I think it would be surprising to retain old services, if
loading a config file that contains a new set of services. So reset the dict
whenever calling `config()`.
Test for config() ints as strings

Cast all integer values to integers, in case we're provided a string. Test
for this when testing all valid config options. Pass integers in the more
specific tests.
Don't call config() for non-config tests

Set the appropriate attributes on `CdnFastly` instead. This vastly
simplifies most of the tests as we no longer need to use the annoying
`CollectdConfig` syntax or setup as many options (to avoid exceptions from
missing `ApiKey` or `Services`).
Add MIT license.