add spoofing capability to geo

and a ridiculously complicated bit of code to test it..
Most of the changes in tests.js are actually indentation corrections.)