Merge #709, close #467

WIP, still need to look at the signature tests