improve gen_gallery.py

- add captions, contents and section titles
fix sidebar links
move _gallery_template contents to new doc/gallery_template.html

- clean up
improve gen_gallery.py

- modify static resources link (-l flag)
- update doc/gallery_template.html
fix output suffix for time-dependent problems in generate_images()
fix logo link in doc/gallery_template.html
fix default opacity in Viewer
Merge branch 'i167' - closes #167
update AUTHORS
remove compatibility function sorted()