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

Fixes #14 
The following four lines are repeated across different tests. Make a new method, e.g. called `signup_and_signin`.