Move some includes around to fix compile errors on OSX; if this breaks any other environments then feel free to revert this. (nw)