Implementing creating and saving flags to the database

Colors are not being saved properly as of this commit. They come back
out of the db lighter than they go in. Wat.