Appveyor setup

This is continue work of #451, also fixes #561.