Initial advanced search implementation and changes references module to use it.