Integrate remaining

Merge in the rest of rsharman's changes, solves #1