separating code

I want to use this as a library so I split out the rendering code from the height map code.

Please add a license file, preferably MIT.