refactor protocol->encoding
fix references to encoding
remove unused dep
'hide' encoding and crypto
Merge pull request #564 from maraoz/ref/dirs

Refactor dirs, part 2