Perlin noise generator

Code taken from:

http://devmag.org.za/2009/04/25/perlin-noise/