Make 'remote_machine' private to lib/substitute.c, and fix all the user to use