Identified common part of code to refactor. created method handleContext in util.class.php to deal with this.

Added function handleContext to improve code reuse while refactoring (Feature Request #1466)

Minor refactoring done on PMA_Util::getLatestVersion()
 and PMA_sendErrorReport() (Feature Request 1466)

Signed-off-by: Sachith Seneviratne <sachith500@gmail.com>