fix infinite loop when loading a player

When loading certain objects with recursive objrefs (e.g. a player with
items in the inventory), the check whether a subordinate item is
RPC-local runs into an infinite loop (because it tries loading the
parent object again which is not actually loaded yet, etc.).

This is fixed here by adding objects to the RC cache *while* they are
being loaded, which is a bit hacky and would not be necessary if the
RPC-local test did not require fully loading objects in certain cases
(e.g.: item local? -> owner (player) local? -> player must be
loaded to check if location is local).

Added a test to verify the fix, and made persistence layer functional
tests less dependent on mock objects in the process.
more resilient logging

* don't fail if the first argument to a log call is null or undefined
* the return value of addField is never used, so remove return statement
add some log output to authentication
avoid incorrect ERROR messages

(only log an error if there actually is one)
minor docs fix

(jsdocs weren't properly updated when code behavior was changed)
return remaining amount in Player.addToAnySlot

(required for the corresponding API function apiAddStackAnywhere)
add item handling function: Item.getPosObject
Merge pull request #16 from yelworc/bits-and-pieces

various bits and pieces