Added common method to convert an AC matrix to AB bytes.

This method is for later use (in Access Condition tool).
Refactored some methods to be more consistent.