Added some critical search functions (exist, eq, ne). Plus lots of cleanup.