Added unit tests
Added pre-commit hook to run tests.