Add option to control safe mode

Add option to control safe mode in preparation for include directives being supported.

- add option to options page to set safe mode
- temporarily disable includes using max-include-depth=0 attribute
- set base_dir to dirname of window.location.href
- add help to all options and link to user manual
- minor cleanups