adds server mode
created tests for server mode
Merge pull request #23 from rogeriochaves/master

Added server mode with tests