Helper functions and scripts for bibdk