Re-Imeplement renderEngine optimizations and implement needed changes into Spoutcraft API.

Fix for null pointer exception when toggling Ambient Occlusion.

Signed-off-by: Mike Howe <dockter@almuramc.com>