Branch off from `nalanda-rc3` for initial work to refactor test modules for #2177 so running the tests with `HEADLESS = True` in settings will work.
Some PEP-8 fixes and refactor the browser test asserts.
Add exam mode assert for `browser_login_student()`.
Cleanup comments and logging codes.
Initial fix to override calls to javascript modal dialogs like `alert`, `confirm`, `prompt` because the GhostDriver of PhantomJS does not support it yet.
Merge branch 'nalanda-rct3' into feature/2177-Make-PhantomJS-work-for-headless-tests
Inject javascript codes to override the modal dialog functions for PhantomJS browser.
Use custom `click()` method if using PhantomJS.
Working codes for PhantomJS hacks.
Refactor `control_panel` unit tests to use the `browser_click_and_accept()` method instead.
Skip tests at the `distributed` app which also does not work even on browser tests.
Merge branch 'nalanda-rct3' into feature/2177-Make-PhantomJS-work-for-headless-tests

Conflicts:
	kalite/distributed/tests/browser_tests/base.py
	kalite/distributed/tests/browser_tests/distributed.py
Resolve conflicts during merge of `nalanda-rct3` to branch.
Skip browser tests on `distributed` app when `settings.CONFIG_PACKAGE` is set.
Skip tests if `HEADLESS = True` for now because they fail.
Merge pull request #2207 from cpauya/feature/2177-Make-PhantomJS-work-for-headless-tests

Feature/2177 make phantom js work for headless tests