Refactored parse_pda

TRANS is now defaultdict
str.startwith accepts multiple prefixes
Refactored process_input() and fixed a bug in regex