Functional units: mag, dB, and dex

Now that `Unit` and `Quantity` have calmed down a bit, something a bit bigger: introducing a framework for functional units and an application to logarithmic units, so that one do things like `dex(cm/s**2)`, `dB(mW)`, and `mag(AB)`. 

I think the usage I have in mind is best illustrated through an example -- see the output from an ipython-notebook session using magnitudes on http://www.astro.utoronto.ca/~mhvk/functional_units_magnitudes.html

For here, just a very brief outline:
```
In [1]: import astropy.units as u, astropy.units.functional as lu
In [2]: iv = lu.Magnitude(100. * u.ct/u.s)
In [3]: iv, iv.quantity, iv.unit
Out[3]: (<Magnitude -5.0 mag(ct / s)>, <Quantity 100.0 ct / s>, MagUnit('ct / s'))

In [4]: iv.unit.physical_unit, iv.unit.functional_unit
Out[4]: (Unit("ct / s"), Unit("mag"))
```

I hope initially to get feedback mostly on whether this covers what usage people can foresee.

Some notes:
-  This is meant as a more general alternative to the `Magnitude` class of #1577. In practice, the idea is not dissimilar; the main difference is that rather than store a zero-point magnitude, the unit corresponding to mag=0 is stored (or, equivalently, what one divides by before taking the `log`).
- Like #1577, this explicitly is about *units*, not magnitude systems (see discussion in #1577, which convinced me that this is the right approach).
- There are a lot of test cases, but no documentation yet, as I want to be sure people agree with the approach.
- Similarly, I have not yet worried about reading in functional units from strings, or writing out to formats other than `generic` (i.e., no FITS, etc.)
- I decided not to subclass from `UnitBase`, as that required much larger changes to `units` (see my earlier trial, https://github.com/mhvk/astropy/tree/units-functional). However, an abstract base class with expectations of what any unit should provide might be helpful. Technical advice very welcome!
- The commits before https://github.com/mhvk/astropy/commit/9bcf3b4f7d2a77e50b6d6fca2f9b2908ed192156 are from #1628, and only introduce `dex`, `mag`, and `dB` (without underlying physical unit).
I guess my instinct was that these functional units are sort of like defining new base units.  That is, if I make a new unit `foo`, I can do this:
```
>>> foo = u.def_unit('foo')
>>> q = 1*foo*u.km/u.m
>>> q.decompose()
<Quantity 1000.0 foo>
```

So along the same lines, I would have thought I could do:
```
>>> q = 1*mag(Jy)*u.km/u.m
>>> q.decompose()
<Quantity 1000.0 mag(Jy)>
```
or similar.  You could also introduce a ``decompose_inner`` or something like that to do ``mag(Jy.decomposed())``, but probably better to just leave it to the user to re-define the functional unit if they need it in that case.