Refactor event handler to use an intermediate loadPage function
We broke a test! Fix the broken functionality by reinstating logic
Load requested content via ajax instead of re-loading the page

This is even better than resetting yourself to #main — your scroll position won’t change at all!
The tests begin to get more interesting here because we are using Sinon to mock out a server backend.
Move the AJAX response content into the test file to reduce ambiguity

The other approach works, but this is more straightforward and keeps the tests more what-you-see-is-what-you-expect.
Merge pull request #3 from kadamwhite/ajax-loading

Load images via AJAX on keyboard navigation