Use sharding and parsing code from utils.Contig

Fix #59 and fix #25