Add forward and backward looping. Add code to swipe between pages for Lion. Cleanup.

Add forward and backward looping.
- In dual page mode looping in reverse on an even number of images may
cause one image to repeat in two sets when approaching the start page.

- Add code to swipe between pages for Lion.
git cherry-pick 616e6a8 -n

- Cleanup.
Fixed missing company name. Fixed variable initialization order. Few additions to ignore list.

- Initial commit.
Fixed warnings and compile errors.