Reimplemented penalize_magics_key
Reimplemented test_magic_completion_order in test_completer.py
Merge Pull Request #3801

Autocompletion: ordering of completions for magic commands and variables with same name

closes #3723
closes #3801