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.
No problem. Probably some tab x spaces issue.