Moved arrays and webgl functions onto geometry so this can be shared
Added a layout variable to geometry as this is cleaner