fixed error caused by argc/argv mix up in cookies()
fixed error in error handling where previous error code is not carried over for incomplete error responses
created basic tests (also added test mode flag in pint.php) using phpunit