Several fixes to the QueueManager in particular when jobs are killed.
Removed a number of obsolete functions.
(1) A few style changes. (2) Added fclose to a function that used fopen without closing the resource later on.

TODO: This class needs a major clean-up.
Fixed broken killing/removing jobs from the queue.
Cleaned spurious characters in Database.inc.php.
Bug fix in the check of the return value of strpos() in Shell.inc.php.
Merged job killing fixes from branch devel into Hackathon2013.
Merge branch 'origin/Hackathon2013'