Added integration tests and fixed issues when interfacing with Linq to Entities