Improve Frame.stack and correctly infer type of values (fix #192)

The bug #192 was caused by the fact that Frame.stack returned values as
a column of type 'obj' and so the expansion based on the static type of the
vector did not work. We could change expansion, but I think it is better to
make sure that static types are propagated correctly (this also makes things
work better with R - as the added test shows).

I did some minor improvements to how we infer types from values (which is
also used when reading data from R data frames) and used this to implement
`Frame.stack`. I also did some performance tweaks, so `Frame.stcack` is now
~4x faster on a frame 1000x1000.