Get database name correctly for search.

This also ensures that the value from the document is not nil or empty.
Get correct env variables in index.

The variables had a '$' prefixed. That is wrong.
Some todo notes.
If no files given index all notes from today.

This should now index the notes taken today if no filenames are given.
TODO note about indexing by date.
Merge branches 'master' and 'develop'