Refactoring

Lots of refactoring and code style. Update jQuery version. Fix some bugs. Show a notification when search wraps around.