General improvements.

* Remove the need for the global `error` variable.
* Replace global color variables for functions instead.
* Better ruby version checking.