Tests: add test for Form, add missing methods in MockDatabase; ViewForm: fix bug causing the preview to not work when it's first loaded