Move autojoin code to separate repo