Code cleanup.

* Added some specs.
* Added some @doc's.
* New option support: server_name.
* Get rid of p1_loggel dependency.