Move TypeScript definitions to js/lib/
Properly handle initial file input