Update to better support MVC4

It's not perfect yet, but it seems to be working on my MVC4 project. (Probably more testing needs to happen on the MVC3 version.) Feel free to give me any feedback.