Refactor components into separate files

Closes #4