A re-write of the CollarDB scripts