Cleaned up code. Added classes for AttributeQueryConsumer
More changes