Moved private class to it's own file

Various other tweaks after pairing with JR.