Revert "remove no longer needed NumberHelper.equality"
It is needed again.

This reverts commit 5316603ce.
fix Complex.equals: should not depend on coefficient type
MatrixType.realEntryType: do not overwrite entryType

entryType should stay as initialized so that code that needs the
original value is not compromised. As IntegerType properly implements
equals() now, that should not be a problem.
number helper: use null-safe equals check
avoid null pointer exception in case name provider returns null
add method to approximate a double by a rational

algorithm taken from http://www.johndcook.com/blog/2010/10/20/best-rational-approximation/
add type checks for expressions (#2)