Fix summary for 1 value variables (python 3)

In python 3, running pm.summary on one value variables (1d traces) give
an error (line 123 of trace.py):

  TypeError: type numpy.ndarray doesn't define __round__ method

Running this code on python 2 versus 3 will reproduce the error (numpy
1.9.0.dev-74e5c12).

  import numpy as np

  x = np.arange(4)

  index = None
  mean = x.mean(0)
  print(round(mean[index], 3))

To avoid this, I have changed the code to use the following method for
1d traces.

  import numpy as np
  x = np.arange(4)

  index = 0
  x = x[:, None]

  mean = x.mean(0)
  print(round(mean[index], 3))

The commit also moves stats calculations outside the trace index loop to
avoid unnecessarily repeating them.
Warn if try to summarize variable greater than 1d

Trying to summarize a variable with greater than one dimension results
in an error (trace.py 121):

  TypeError: type numpy.ndarray doesn't define __round__ method

With these changes, variables above 1 dimension are skipped and a
warning is given.
Move summary function to bottom of trace.py

To avoid splitting up NpTrace and MultiTrace
Rewrite trace.summary

Main changes
- Do not use `+=` to build lists for output
- Use str.format to control spacing/padding
- Use str.format to control rounding
- Don't overwrite builtin `buffer` (python 2)
- Combine common code for stats and posterior quantile output
- Split summary into separate functions/classes to make it easier to test
Merge pull request #401 from kyleam/fix-summary

Fix summary