Generify database row into data container

This code is useful for other things than just database rows, so I would suggest moving it to a generic class.