Reorganized + pulled in many minor changes from closed-source repo