v13

As discussed in #80, this pull request covers #63 and #65 and rebases to Toblerity/master