Under 500 lines of code before the client

http://github.com/gregoryyoung/m-r

 

I will write a blog post about some of the stuff in it but its pretty straight forward.