Drop support for PHP 5 2

This patch raises requirements to PHP 5.3 and drops many code which was written just for PHP 5.2 compatibility.