Also solving several issues along the way. Progress on #18. Closes #15. Closes #13. Closes #10. Closes #16.