Optimized LTRIM

When several consecutive nodes are removed from the tail or head of a given list, the new algorithm reduces the overhead of removing nodes one by one and the intermediary operations (set new head/tail, update links...).