refactor into multiple files

should lets us have multiple builds to help with #16 and we can also do some code cleanup to help with #17