Added mechanism which automatically cleans database of historic data upon
any request that requires common.php. A time interval check was also put
in place so SQL queries cleaning the database are performed every second -
it only needs to be done every THREE MINUTES. common.php is just a trigger
point for it to happen.