Add application handeling

Fixes #15