Local local infile handler

Implement the local infile handler functions locally so that they don't crash. See #422, #336, etc.