Api: new resource to add hooks
api: change payload format from json to simple text
api: setup bare template dir for tests
hook: use fs write to improve testability
Merge pull request #99 from bardusco/master

Fixes #98