Some changes and WP8.1 support

The error stuff doesn't actually work yet. However Windows Phone 8.1
stuff does work.