Fixed searching in nested messages. fixes #6
Separated search code from message structure.