Move input module into separate file.