Algebraic construction of Witten's top Chern class