Adding a class to validate arguments

This change allow us to use less code because the `Preconditions` class validates if the argument is valid.

In the ae72b00 commit more exception is changed to `MirrorException` like #69. Sorry because I miss some places.

Thank you.
I think that git is crazy changing all lines :(