Fix flushing of commits to always force flush the last batch

Fix:
 * Flushing commits to take a 'force' param to force the last batch of
   commits to be flushed (the last set was not being saved to JSON)
 * A shadowing issue of the variable 'file' in commits.rb