Refactor forms, startup etc.
Add missing files.