Build properties db

This is a full rewrite of #1380 (only the db part), as my git-foo is not good enough to let me do that kind of magic. So please review it carefully.

All data and process stuff has been left out.

I'm keeping #1380 around as reference.
I would like that we try to create a unique key on that table.
The unique key would be something like int(sha1(buildid + name))