Fix and refactor methods in database class. Add sites addition with unique code

Fixes #14 
You could also rename this method to be more descriptive, just as we did with `code_unique?`.