ctdbp_cdef parser

Optimizing some logic, fixing formatting