Clean up duplicate_params check a bit
Clean up unquoted_file_mode check a bit
Speed up file_mode check a bit by precompiling the regex