Dispatch process re-structure.

A new library class lib/WebApplication.php was created to orchestrate
the initialisation.
Added flexibility in request parsing, now allowing for custom
permalinks.