Merge spec branch into master

This PR basically contains my last two weeks of work; I now consider this more or less complete (for the time being), and it's clear that fixes that now go into this branch should have gone to master, so I want to merge this.

Basic description at http://hashdist.readthedocs.org/en/spec/

I'll wait a day or so and then hit the button (provided Travis tests passes).

----

Ondrej: Here is how to try it out:

### Init
```
git clone https://github.com/hashdist/hashdist.git
cd hashdist
git checkout -t origin/spec
export PATH=`pwd`/bin:$PATH
```

### Test
```
hit init-home
git clone https://github.com/hashdist/profile-template.git
cd profile-template
hit build
```