fix Access Denied error on windows XP
factor signal handling out into its own class
refactor windows-specific code to have better structure and move imports to top