St Johnstone have signed David Wotherspoon after the midfielder's contract expired at Scottish Professional Football League rivals Hibernian.