Refactor and re-implement

Refactors some of the code into modules. One major change is using gradient
coherent noise for perlin noise generation, which tends to have fewer
artifacts.
Merge pull request #8 from Aatch/master

Refactor and re-implement