Forward-port STL binary writer from master, pulling in horizontal position stuff.