Add Lucas D search limit, move perfect square test into D search
Small ECPP change