Validation

So I finally decided to make this a pull request before it grows even bigger. Sorry for the size, but at least its broken down into many tiny commits. :-)

This is close to the final version of the entity validation: I have little more that I could add without further input. In particular I would appreciate input on what to validate in / on: Block & Feature entities.

The following changes go beyond just the validation and might need discussion:
-As proposed in the issues I have implemented ```as*Dimension``` type specific getter in the ```Dimension``` entity. Therefore changing the order in which the classes get defined in ```Dimension.hpp``` was necessary.
-As proposed in the mailing list in some classes I split the multi-getter (e.g. ```references```) into two overloads instead of one method with default parameter to allow passing it to the validation.
Basically what you need in for the conditions is a simple getter for unit. Don't you think a small simple helper like this would be easier to read, nicer to call and less compiler dependent?
```c++
optional<std::string> getUnit(Dimension dim) {
    DimensionType type = dim.type();
    optional<std::string> unit;
    
    swich(type) {
        case DimensionType::Sample:
            unit = dim.asSampledDimension().unit();
            break;
        case DimensionType::Range:
            unit = dim.asRangeDimension().unit();
            break;
    }
    
    return unit;
}
```