Updated Readme
Added testcases and refactor for testability