Improved gene_order script.

* Added more error checking.
* Fixed sorting not being assigned.
* Added changing log level to script.
* Other minor fixes.
Added debugging messages and fixed bugs.

* Added debug messages for testing.
* Fixed bug that was introduced when adding error checking.
* Fixed sorting bug where the position was being compared
as strings instead of as integers.