Levelization: source code structure

This de-tangles dependencies:
* basics/ no longer depends on any other modules
* crypto/ depends only on basics/
* protocol/ depends only on basics/ and crypto/

Reviewers: @scottschurr @mtrippled 
From Slack chat today, Howard wrote: "Always prefer member begin over namespace begin."  If I'm understanding him correctly, then this would be better written as `first = s.begin()` since we know `s` is not an array.