Implemented registration protocol
Merge pull request #7 from Johnnei/Registration

Implemented registration protocol