sqlite, ui and view models

i have taken full code from master branch and merged it. code is latest so you accept this blindly :)