factor out chainlinks
refactor of sig table construction
some stuff working
bugfixes