Compilation and Fast Model Counting beyond CNF