Implemented precedence rules ("&" operators evaluated first)

Search function now accepts LocatedEntity* vector.
This is likely a temporary solution, as it doesn't support
parenthesis and can be written in a neater way.