Replace our boolean "rewrite" flag with a set of submodules to rewrite
WIP
Keep track of submodules changed/written instead of just remembering
that .gitmodules needs updating
Add an assertion to catch infinite loop

Stop going around in circles; if it takes more than 500 passes to
write a single SVN revision, there's a bug somewhere.
Track stale submodule refs separately from submodules that are actually changing
Add a missing const
BUGFIX: moving from changed_submodule_refs was causing can_close() to turn false

Instead of what we did here, we could have zeroed
submodule_refs_written at this point.  While that would probably be
more efficient, I'm not ready to throw that information away.
Properly nest APR pools
.gitignore a whole category of subdirectories starting with .build

This allows us to keep a release build along with our debug build
Merge remote-tracking branch 'origin/master'