Infinite set examples.

Here are two interesting Set implementations that give up the ability
to act as containers in exchange for the ability to represent infinite
sets.

MathSet is more conservative: it represents either an explicit, finite
set of elements, or an implicit universe with an explicit, finite set
of elements removed.

PureSet basically just reifies A => Boolean as a set. As such, it has
no idea which members (if any) it contains. However, this also makes
it easy to define operations like cartesian product.

Both sets have some methods that require a universe value, specifying
the list of all possible members of the set.
Added cforRange and cforRange2

These macros are a bit nicer to use than cfor, although they are also
less flexible. The basic idea is:

    cforRange(0 until 100 by 4) { i =>
      ...
    }

becomes:

    var i = 0
    while (i < 100) {
      ...
      i += 4
    }

The following kinds of ranges are supported:

    start until limit
    start until limit by step
    start to end
    start to end by step

Non-literal ranges are also supported, but will issue a warning, since
they can be slower. The warning may need to be removed, we'll see.

The cforRange2 macro is similar:

    cforRange2(1 to 5, 2 to 4) { (i, j) =>
      ...
    }

becomes:

    cforRange(1 to 5) { i =>
      cforRange(2 to 4) { j =>
        ...
      }
    }

and then:

    var i = 1
    while (i <= 5) {
      var j = 2
      while (j <= 4) {
        ...
        j += 1
      }
      i += 1
    }

That's all there is to it.

Conflicts:
	core/src/main/scala/spire/syntax/Syntax.scala
Benchmark problem fixed

Implemented private lazy val _degree: Int in PolyDense and PolySparse
Fixed issue with benchmark as a result of _degree incorrect
implementation
Tidied up Polynomial companion object methods
Use array-backed Sparse polynomials.

This refactors the PolySparse implementation to use 2 arrays rather than
a map. This gives a good performance bump for all operations.
Get rid of unnecessary allocations in PolyDense#*.

This was using Array.fill which allocates a thunk, and a builder.
Switching over to just using new Array & cfor has a nice bump in the
benchmarks for small polynomials (<= 4).
Add some documentation to the polynomial methods.
Fix PolySparse evaluation.

A few bugs here! Things are working correctly now.
Fix bug in PolySparse#foreachNonZero.

Aside from fixing what would likely be an IndexOutOfBoundsException,
this also removes the check to see if a coefficient is non-zero.
PolySparse's coeff array should never have a 0 in it. If it does, there
is a bug in the construction, not in foreachNonZero.
Remove type class instances from Term class.

All the type class instances have been moved out to the methods now. The
main victim has been toString, which now uses some rather ugly
heuristics to make pretty strings.
Semiring extends AdditiveMonoid.

This switches Semiring to extends AdditiveMonoid rather than
AdditiveSemigroup. This means that Semiring still subsumes Rig and Rng,
however adding in a zero makes it much more useful. The downside is a
loss of generality, but I can't think of any Semiring without a zero.
And if we didn't have a zero, we could always add one by lifing the type
into an Option.
Remove type class instances from PolySparse/Dense.
Add a more type class instances for Polynomial.

This adds type class instances for Semiring, Rig, Rng, Module, and
VectorSpace for Polynomial.
Minor fixes to Polynomial GCD.

The GCD for polynomials had weird behaviour. While technically correct,
saying that the GCD of (x^2 + 2x + 1) and (x - 1) is 4 isn't what I
expected. This was first fixed by returning the GCD as a monic, but then
we get 1 as the GCD 2 * (x^2 + 2x + 1) and 2. So now we first factor out
the GCD of the 2 polynomials, so the leading terms are coprime. Then we
find the GCD as a monic, then multiply by the factor we first pulled
out.
Coax PolynomialTest into passing again (ie. fix bugs).
Add Polynomial GCD tests.
Merge remote-tracking branch 'upstream/master' into topic/array-sparse-poly

Conflicts:
	core/src/main/scala/spire/math/Polynomial.scala
	core/src/main/scala/spire/math/poly/PolyDense.scala
	core/src/main/scala/spire/math/poly/PolySparse.scala
Merge pull request #153 from tixxit/topic/array-sparse-poly

Array-backed Sparse Polynomials, type class instances moved to methods, and some other minor updates
Use foldLeft in Seq GCD.
fix a few kleene demo bugs
Faster derivative/integral for PolySparse.