See description to full update

Moved helper functions from document ready scope to global scope.
Removed unused nl2br function
Fixed scrolling to object after appending data(@fn scrollToAppend)