Update function mocking to store results and pass by reference.
Update unit tests to not use external resources.

WARNING: `Unit` class no longer has the method `_hasNetwork()` it has been moved to `Integration`. A better alternative, for unit tests, is to stub function calls in `Mocker::overwriteFunction()` or full classes in `Mocker`.
update \lithium\net\http\Request::referer() to correctly identify local urls which contain a full url string
correct \lithium\net\http\Request::env('REMOTE_ADDR') when $_SERVER['HTTP_X_FORWARDED_FOR'] is specified to return only a single ip address as expected

see http://stackoverflow.com/questions/753645/how-do-i-get-the-correct-ip-from-http-x-forwarded-for-if-it-contains-multiple-ip
and http://en.wikipedia.org/wiki/X-Forwarded-For
fix for issue #774

ensure explicit request variables with value 0 are not treated as though they are undefined.
Reduce the utilization of superglobals in tests.
Fix `test\Unit` to be 5.4.12 compatible.
verify that the model provided to the Form Auth adapter exists prior to attempted use
Fix failing tests caused by the test API changes.
Fix a difference beetween UI and console testing.
fix misnamed write method parameter in logger output adapters
Modify AssertArrayHasKey and AssertArrayHasNotKey

Currently the new Assertion methods only check for a key
with `isset` and that a value is present (not null).

This change modifies the `isset` to use `array_key_exists`
to verify a key is in an array regardless of the value of
they key. This ensure if the value is null, and they key
is there the test passes.

It also checks to see if ArrayAccess is being inherited
from. If so it falls back to isset since `array_key_exsts`
only checks primitive arrays.
add a test to demonstrate failure of deeply nested document 'exists' attribute
fix issue where a document retrieved from the database would not recursively set the 'exists' flag for all nested documents
fix typo in $nor operator reference