added unit tests for composite keys; added fix to handle cyclic associations