Implement IN queries and Count, add some basic tests