Request: Lazy-initialise PHP session

* Change debug mode perservation to use a cookie instead of
  session so that we don't have to initialise the session just
  to check whether debug mode was previously set.

* Add 'cookiePrefix' setting in the configuration so that tools
  can avoid clashing with other tools on the same domain.

* Re-order initialisation flow to allow LocalConfig to set
  the cookiePrefix *before* initConf() is called (since we use
  the cookiePrefix there to detect debug mode).

* Remove unused session functions in BaseTool class. These were
  for Toolserver to avoid clashing in the session, but, whilst
  cookies can still clash, sessions are private in WMFLabs.