Annotations filter by viewport

Implementation for #540 and related minor improvements.
The reason why it works with `PUBLISH_FIELDS` and other similar things we are doing is because it is wrapped into a function call so it returns new object every time. Here you have only one object everywhere.