[Tests] Added tests based on mocha and should.js. Renamed tests-folder to test, in order to match mochas defaults.
[Tests/Lib] Additional unit tests, some fixes for bugs and improvements.