Move some code to a function to avoid future duplication. Allow autocomplete on ping page. Add more escaping to command.
Fixup source address options on Test Port page.