Implement a template-based classical Perlin noise generator.

The mask argument of the Impl template is there because apparently
an inner template cannot be fully specialized, so there needs to be
some argument besides i.
Fix the lua script not printing any errors if executing a file fails.
Use a better hash function in the Perlin noise generator.
Remove the use of lambdas in buildingplan.
Add a Perlin noise test script.