LU Factorization with Panel Rank Revealing Pivoting and its Communication Avoiding Version