[WIP] Refactor package

Closes #19, #18, #11.
Needs error check