Implement Signed and Unsigned traits and remove related predicate functions
Implement Natural trait

This adds the following methods to ints and uints:

- div
- modulo
- div_mod
- quot_rem
- gcd
- lcm
- divisible_by
- is_even
- is_odd

I have not implemented Natural for BigInt and BigUInt because they're a little over my head.
Improve divide-by-zero error messages
auto merge of #6041 : bjz/rust/numeric-traits, r=brson

As part of the numeric trait reform (see issue #4819), I have added the following traits to `core::num` and implemented them for the appropriate types:

~~~rust
pub trait Signed: Num
                + Neg<Self> {
    fn abs(&self) -> Self;
    fn signum(&self) -> Self;
    fn is_positive(&self) -> bool;
    fn is_negative(&self) -> bool;
}

pub trait Unsigned: Num {}

pub trait Natural: Num
                 + Ord
                 + Quot<Self,Self>
                 + Rem<Self,Self> {
    fn div(&self, other: Self) -> Self;
    fn modulo(&self, other: Self) -> Self;
    fn div_mod(&self, other: Self) -> (Self,Self);
    fn quot_rem(&self, other: Self) -> (Self,Self);

    fn gcd(&self, other: Self) -> Self;
    fn lcm(&self, other: Self) -> Self;
    fn divisible_by(&self, other: Self) -> bool;
    fn is_even(&self) -> bool;
    fn is_odd(&self) -> bool;
}
~~~

I have not implemented `Natural` for `BigInt` and `BigUInt` because they're a little over my head. Help with this would be most appreciated.
libcore: remove @Rng from rand, and use traits instead.

Also, rename RandRes -> IsaacRng, and make the constructors static
methods.
libcore: convert the Program @-object to be a plain struct + impl.

Removes the dynamic @ indirection, and also converts the functions acting
on `ProgRepr`s to methods.
libcore: unify `gen_<type>` methods on `rand::RngUtil` into the generic `gen`.

This moves all the basic random value generation into the Rand instances for
each type and then removes the `gen_int`, `gen_char` (etc) methods on RngUtil,
leaving only the generic `gen` and the more specialised methods.

Also, removes some imports that are redundant due to a `use core::prelude::*`
statement.
libcore: remove unnecessary deref
auto merge of #6036 : huonw/rust/core-less-at, r=nikomatsakis

From a cursory `git grep` this removes the last part of `core` that requires on `@` (other than `io` and the task local data section).

It renames `RandRes` to ~~StdRng~~ `IsaacRng` and `XorShiftState` to `XorShiftRng` as well as moving their constructors to static methods. To go with this, it adds `rng()` which is designed to be used when the programmer just wants a random number generator, without caring about which exact algorithm is being used.

It also removes all the `gen_int`, `gen_uint`, `gen_char` (etc) methods on `RngUtil` (by moving the defintions to the actual `Rand` instances). The replacement is using `RngUtil::gen`, either type-inferred or with an annotation (`rng.gen::<uint>()`).

I tried to have the `Rng` and `RngUtil` traits exported by `core::prelude` (since `core::rand` (except for `random()`) is useless without them), but this caused [an explosion of (seemingly unrelated) `error: unresolved import`'s](https://gist.github.com/5451839).
Refactor core::run to remove the ProgRepr struct, which was
a legacy from the time when destructors were implemented
using resource types.
Removed ascii functions from other modules

Replaced str::to_lowercase and str::to_uppercase
Fixed typo... And a billion other things.
auto merge of #6029 : Kimundi/rust/ascii-encoding, r=thestinger

Replaced {str, char, u8}::is_ascii
Replaced str::to_lower and str::to_upper
auto merge of #6044 : Dretch/rust/run-remove-progrepr, r=graydon

...which was a legacy from the time when destructors were implemented using resource types.
Fix incorrect replacement of `modulo` with `rem`
Move impls of `Num` out of core::num and clean up imports
Use #[cfg(not(stage0))] to exclude items from stage0

As requested on the mailing list: https://mail.mozilla.org/pipermail/rust-dev/2013-April/003713.html
Rename Natural to Integer

'Natural' normally means 'positive integer' in mathematics. It is therefore strange to implement it on signed integer types. 'Integer' is probably a better choice.
Use borrowed pointers for Integer methods

This brings them in line with the quot and rem traits, and is be better for large Integer types like BigInt and BigUint because they don't need to be copied unnecessarily.
Add Fractional, Real and RealExt traits