Output is now more easily plugged into Jed.

Also some code refactoring, and changed function arguments.