Added file encoding support with options and autodetection
Minor changes to katywings' encoding PR

Closes #95