some refactorings, added "GetAvailableCaseActivities" and moved some tests from example project to code base