Adding unit tests and fixing cipher to shift correct direction.