Loooots changes!

Make all templates uniform using the same search fields.
Extract common code considering dates.
Fix corner-case bugs in inside() and active() methods

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>