Started work on profile and XML serialization

Also, the main window now saves and restores its state because why not?