Improve StackPanel layout.

Taken measure/arrange implementation from Moonlight. Added
Min/Max/Width/Height properties.