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

Fixes #14 
How would one test the `create_unique_code` method if it creates a random code every time?