Moving testing code to shared
speeding up tests by NOT generating a key every time.
slowing down tests (and fixing failures) by not trying to cache _own_device (more failsafe anyway)
using persistent browser to (slightly) speed things up, removing debug prints
Merge pull request #606 from bcipolli/fix_tests_part_2

Fix tests part 2
Looks f'ing brilliant!  Now go use this to conquer the world!!