Added Unittesting

And a bunch of other stuff