Move extensions to library
Allow sorting on calculated fields