Simplify/improve Application.instances, use flatMap instead of map
Merge pull request #1 from magro/master

Improve Application.instances, use flatMap instead of map