Stencils

Stencils are broken when using the NVIDIA driver in linux. Trying to fix.
reverted stencil change

I only made the change because the stencil implementation wasn't working
when the nvidia driver is used instead of the nouveau driver
Ensuring that edit buffer and floor grid remain unaffected by any bad state left by render()

This is done by restoring the OpenGL to a sane state after the render
call in case it was left in a bad condition, such as remaining in stencil
drawing mode.

Added a test case to demonstrate.
Portals and camera base transforms