Filter in insert_with_lock_in, fix scrolling. Fix init.

I got tired of messages getting pushed out of the queue by spam, so I
decided to change things up and hook in to insert_with_lock_in instead.
Now the line counter is based on the currently displayed messages and
scrolling works properly.

Please give this code a shot and let me know what you think!