Star formation in Chamaeleon I and III: a molecular line study of the starless core population