Split into multiple files. Closes #1