MAINT/BUG/TST/ENH: Address PR comments

- Make the tests be more strict about the insertion of a new row into a
  table.
- Add additional checks to avoid duplicates.
- Make a better use of the API to insert new terms into the database
  when the system is initialized.