Linear to ReversePolish classs

Completely rewritten.