Add testcases and file IO code