Use parametrized dynamic evaluation
Move the PS1 template out of the main loop
Main loop encapsulated in a sub
Main loop: move $FIFO out of the loop
PS1: fix time
Split the eval step (sub interpred) from formatting (sub expand)
Optimize the template before entering the main loop

The template is optimized by rendering content that is not dependent on
dynamic behaviour. Rendered colors and static text are concatenated as
strings.
tput: capture STDERR

Use IPC::Open3 for capturing command output while hiding STDERR.
Cache terminfo detected capabilities
Implement $PATH lookup (&which) and use it in &run