* [FIX] Fixed wrong behaviour when ordering custom field by required option. Thanks to @Fizard for the feedback. Related #957 * [MOD] Code refactoring * [ADD] Unit tests. Work in progress