Initial set of tests and minor refactoring

@bezidejni Check https://github.com/appsembler/launcher/commit/fec7ff75b5e7c5f9fb9590ff53d016e62de05800