Add method for determining whether program is running in debug

Change-Id: Iac870862744770607e0dd3e841085eb97ce4ce52