Adding basic profiler sampling support and restored the --profiler script option

* Also enforce that the profiler is normally off in CLI mode

Change-Id: I35faedff818af2ad459b544c9ad50e77b54b378e
Merge "Adding basic profiler sampling support and restored the --profiler script option"