Fixing some code formatting issues.
Adding more unit tests with mock.