Added handling of CRDB4 and CJDB4 templates

Main code rev. 1966