fix txt options and improve guessing

Change regex used for matching - use the one in the syntax file. Also
fix function not being run for txt files.
fix guess and force options for common file names
add documentation for options