Closes #23, closes #22, closes #12 and closes #27