added unit tests and docs
Merge pull request #1 from ethering/master

Added unit tests and docs