First working commit.  Basic functionality intact. Faster than original, super low memory.