Version 4 complete rewrite of trisphere using rails.