Add mechanism for detecting current execution mode
Merge branch 'master' into geezer

Conflicts:
	lib/realClient.js