Implement checkElement which receives an string or an element and returns the element

Some functions pass the element others a string with element's id. This
functions helps handling that.
Implement history/recent queries