Cherry picking Janin non-merged changes

Various changes to clean up, refactoring and usage of `cowlib` for spdy settings.

Also, `rebar.config` now will point at:
```
ranch  - branch: upstream/master = 1.0.0
cowlib - branch: layer = 1.0.0 + flow-control update (Janin)
```