Cmd fixes

Modified PatchExecutable such that it works on windows. Added tests as well as a small fix in home_tests.