DB finally works, it is still far from complete.