Big refactor, added save dialog (no recording yet)