fixing bugs #707 and #1781

Found that caretUndoStack and caretRedoStack weren't getting caret info pushed to them during edits. The original calls were lost when undo stuff was reorganized; I put them next to the undo.addEdit() call.  Tested on my Win7 64bit machine, works happily for me.

Edit: Also added another bug fix to this pull request, so modes and tools will actually load properly on Windows.

See notes here for details: https://github.com/joshgiesbrecht/processing/commit/62d3768c747c67ba05c401d14223efa26538bb2d