update TODO
bibtex: add error exception class
bibtex: raise BibentryErrors when failing to load bibtex
cli: don't read bibtex from file before passing to document

The bibtex parser in bibentry handles loading bibtex from files.
It also does some exception handling.  So just let it load the file itself.
cli: handle BibentryError exceptions more gracefully.
cli: fetch bibtex before creating new doc
cli: add bibtex to doc before moving on to file

This keeps the bibtex handling stuff mostly in one block.
doc: clarify add_bibtex() usage.
test: add test for failure importing non-bibtex file as source.
add some bugs to TODO
test: add a unicode character, just for fun

This of course causes the bib import to fail.  Encoding!
db: as with the cli, let the doc.add_bibtex() method read bibtex from file

This should help keep the bibtex file reading consistent.
bibtex: use utf-8 encoding when writing bibtex files

The default encoding seems to be ascii, which fails if bibtex includes
utf-8 characters.
bibtex: don't utf-8 decode when reading bibtex string

This was recently mistakenly added in a misguided attempt to solve an
input file parsing issue.
bibtex: use with when opening StringIO

This is the new proper way.
test: add a unicode character to a bib title

This exposes a big bug in piping unicode output to files or pipelines.
test: add test for piping search output to command
cli: use codecs to set stdout writer to utf8

It's unclear if this is the correct thing to do, but it seems to fix
the problem with the output encoding differences between terminals and
pipes/files.  See e.g.:

http://stackoverflow.com/questions/492483/setting-the-correct-encoding-when-piping-stdout-in-python
test: tweak some test names.
test: only refer to add command by 'add'

This is in preparation for potentially using the term 'import' for a separate command.