use more for-comprehensions

replace a lot of map/flatMap calls by for-comprehension syntax
it might be more readable
[new] use scala-arm for resource handling

instead of home-made automatic resource management library, use
scala-arm which is more robust/tested