Fixed `columns_for_distinct` of postgresql adapter
Added documentation for the :param option for resourceful routing
Remove unnecessary include for integration tests.
Always construct route objects with Constraint objects
push is_a?(Dispatcher) check in to one place
eliminate dispatcher is_a checks
Constraints#app should never return another Constraints object, so switch to if statement
one fewer is_a check
nothing is passed to `rack_app` anymore, so rm the params
pass a request to `matches?` so we can avoid creating excess requests
pass the request object to the application
push is_a check up to where the Constraints object is allocated
a redirect is not a dispatcher by definition, so eliminate test
we do not need to cache rack_app
stop hardcoding path_parameters and get it from the request
skip the build business if the stack is empty
Speed-up TimeWithZone to String conversion

I've noticed that `String(model.created_at)` is performing poorly in comparision
with other fields. The source of the problem is a way `Kernel#String` works: it first
tries to call `to_str` (which causes `NoMethodError` in `method_missing`) and then calls `to_s`.

Performance tests:

    tz = Time.zone.now

    Benchmark.ips do |x|
      x.report { String(tz) }
    end

Without this code:

    Calculating -------------------------------------
                               572 i/100ms
    -------------------------------------------------
                            10177.7 (±18.2%) i/s -      48620 in   5.000325s

With this code:

    Calculating -------------------------------------
                              1518 i/100ms
    -------------------------------------------------
                           138984.2 (±10.1%) i/s -     677028 in   4.974897s
rake railties:install:migrations respects the order of railties

This PR fixes #8930 and some stuff from #8985
give all endpoints a superclass
constraints class does not need the request class anymore