Update: I've moved the code from this post, along with resources for designing mouse tracking experiments, and some example data, to a GitHub repository