Closes #16, closes #15, closes #14, closes #12: Complete refactor for
v1.