Add unit tests for password handling