More code cleanup

This does a few things:
* Introduce generics for graph analyzers to follow the example set in agouge/graphhopper-sna and fix casting problems
* Catch an "Exception" rather than explictly catching several subclasses of Exception
* Introduce several "for each" loops to reduce clutter.

What I mean by "for each" is the following: For example,
```java
        for (Iterator<Value[]> it = dataSet.iterator();
                it.hasNext();) {
            Value[] row = it.next();
```
becomes
```java
        for (Value[] row : dataSet) {
```
That is nicer to read.