Fixes #1025, spaces in id-to-taxonomy file break assignment with Mothur.
Fixed error when output_fp was not None.
Added test to cover output to file, fixed bug in formatting lineages.
Address comments from code review.
Address second round of code review comments: properly re-format taxa with multiple consecutive spaces, add try/finally block to close re-formatted taxa file while running app, removed extra temp file in test.
Merge pull request #1725 from kylebittinger/mothur-spaces

Fixes #1025, spaces in id-to-taxonomy file break assignment with Mothur.