upgrade rails to 4, more Thorax porting