generalized and documented tilemanipulation.lua, updated layerswap.lua
Merge branch 'dev-wires' into dev