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

Fixes #14 
Cool. I didn't know if the application class was only meant to hold actions or could hold other methods.