THRIFT-2500

I'm sorry, I have merged several uncommited branches here, so you might want to review this one last.