Worked on it some... see the TODO file for bugs I've fixed, or might have