Environtment-based application switching. Fixes #39.