Annotation search: refactor result table creation

The result table is now explicitly created with createElement() calls. This
makes the resulting HTML less error prone and it is easier to attach event
handlers to single elements.