Feature/v0.4 update

Update to all v0.4 changes. Supersedes #25, #36 and #38 .