Initial Windows support.
Made the console usage more reusable.