clean up code

- new file structure
- consistent names for subfunctions
- improved parising/deparsing
- no stringr dependency