This closes #22, closes #14, closes #24