Updated sqlite to 3080700. Added tests. Fixed profile merge.