Twig Global function are called globally. This means even on a query to the api.
Using a function we can decide when we want to call it.
Also, remove previous `COUNT(e.id)` since it doesn't work on PostgreSQL ...
Instead of performing a complex select (to retrieve all data for entry, etc...) just select the counter and retrieve it.
Down from ~50ms to ~30ms on the unread page (with 500 items)