Add requirements.txt
Move type definition to top of file