Added helper method for serialization in PHP 5.3
Removed static variables of closure from serialization since are not (and must not be) preserved