Add framework for handling XHR errors

Closes #128
Fix tests for locality view, I am an idiot