add validation tests for protocol flags
fix stuff according to JSHint
refactor createServer code

* remove ContactHeader dependecy on createServer
* refactor test cases (remove extraneous ones)
* beautify code throughout the modules