Improve Application detection and EmberDebug reset.

Fixes #48