parser: refactor / factor out validation and error reporting
Move validation and error reporting to their own files; also rework
the validation passes slightly to validate as much as we can of the
netplan grammar in parser passes (so we get context info for errors),
and leave the backend rules sanity checking only to after the parsing.
This way we'll get the error context, unless things are backend-specific
rules for which it's just hard to get the info (and not as helpful).
Partially revert the change for enabling systemd-networkd. network-online.target may not be depended on by anything on minimal images, but multi-user.target already is.
tests/test_terminal.py: Ensure terminal state is restored at end of test
test_save, test_save_and_restore_with_dict: Ensure that we restore the
terminal state at the end of each test, as other tests rely on a clean
state to start. Previously, the tests would work the first time but fail
if re-run.
test_save: also compare self.terminal.orig_flags to the current
terminal flags, as opposed to a copy of itself (which would always pass)