Integrate sfapp. Closes #2