libcore: Move the numeric operations out of Num.

Sadly I could not use trait inheritance due to a type parameter substitution
bug.

r? @brson