Port a bunch of stuff from dino
More stuff ported from dino.