Added search directive

Custom control for search, improved the simplicity of the code.