Refactoring WPF, WP8 and Silverlight

This pull is a preparation for the changes in #239

The XAML stacks in WPF and Silverlight (including WP8) are quite similar. So we can re-use (share) most of the code. The commits should be self-describing.