clear excess zero entries from tuple database
refactor tup and app to share most implementation; factor out argv parsing