Fix BinaryMathOp to avoid ClassCast exceptions.

Also added Mockito to smalivm project so unit tests
could be added for the cases which where previously
failing.