Update extend and copy functions.

The extend and copy functions no longer copy over properties starting
with $$. As part of this update I introduced a startsWith() function
which can check for a prefix efficiently without memory allocation.
Also, since the location service actually on extend to copy all $$
properties and I simply created a function extendFully, which still
maintains the old behavior.