Add support for standalone spy functions and spy objects.

This only supports the standalone mock object/function use case for spys
and doesn't include support for spyOn, pass through, etc.