Add purge argument to Smart Search CLI indexer.

At present, purging the index then re-indexing will result in the configuration of any search filters being lost. This is because the search filters link to the relevant taxonomies using taxonomy ids and these are inevitably changed during a purge/index cycle. This PR addresses the issue by adding a --purge argument to the CLI indexer which, unlike its UI equivalent, completes a full purge/index cycle while preserving the filter configurations.

This change is fully backwards-compatible as running it without the --purge argument results in exactly the same behaviour as before. Some minor code-style improvements on the original code have also been done.

This is a backport for Joomla 2.5 of PR #3346 for Joomla 3.x