Native support for autodetected long data types
Encoding related additions + Allow reading query from a file

* Allow reading queries from file
* Allow selecting the encoding of the query itself
* Allow selecting output encoding separately from input encoding
* Better encoding error reporting
* Additional tests