add tests for BorrowedMaterial
added randomness to TeachingMaterial creation
Merge pull request #749 from davherrmann/issue#746

add tests for Entities