Get the persona from the user, algorithm, and user.
Only push a new reference if it is not white space.
Updated todo list.
Get the id for the indicated reference location.
Check a reference location was supplied; die if not.
Check a work id was supplied; die if not.
Insert or update each reference found in input file.
Update output for when data row is in storage.

If the row being updated or created is "in storage," it simply means the
corresponding row existed before the query.  It does not mean the row was
necessarily updated.
Compute a timestamp for the current time.

Do not add this timestamp to the parameters of the update or create query just
yet, however.
Check a reference chapter was supplied; die if not.

Getting the reference chapter has a quirk right now.  If a line is simply

chapter=0

the regex will not recognize the value (this also is the case if there is
white space before the zero).  The value needs to be set to "00" to be
recognized, probably because it is now being treated like a string, not a
number.
Use a unique constraint to look for references.

Use the unique constraint on (referencing_work_id, type_id, chapter, rank) to
determine if a reference already exists (to update) or does not (to create).
Thus, if a reference's text changes, the row will be updated, instead of a new
reference being inserted.

This does not handle the case where a reference's chapter, for example,
changes.  In this case, the updated version will be treated like a new
reference and will be inserted as a new record.
Update the modified timestamp with the reference.

When a reference record is created or updated, set the modified timestamp to
be the current time.  As a side effect, this will cause the modified time to
be updated every time the script runs on a reference, as this value will be
different from what is in the database every time.
Removed unneeded comments and printouts.
Updated todo list.
Removed completed items from todo list.