Implement Application::GetVersion().

Fixes #4801
config: Make sure we're not inside a comment when reaching the end of a config file.

Fixes #4821