Added calculator tests

And also fixed some minor things and applied formatting.