Cleaned up code

* Made vertex creation much simpler and easier to read.
* Moved texture coordinate generation into a separate function for ease
of use and portability.
* Shortened code