Move functional code out of config.php

Many changes, all geared to cleaning up config.php:

* Removed all code from config.php-dist except for setting variables
* Moved the functional bits into index.php instead
* Improved handling of passing $count in the URL
* Removed some options from config.php-dist that didn't make sense to be user-configurable
* Changed the exclude/include variables so they're both just include
* Added error handling in case the user doesn't create a config.php
* Added lots of comments