Added tests for viewer options/preferences. Fixed bugs that were revealed.

fixed a test due to latest optimizations.

Re-generated the RML reference with the latest version number.