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

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

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

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

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

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