Fixed - was not working for variables in last line of heredoc.

It seems that heredoc() method excludes terminator line, so no need to pop()
https://metacpan.org/pod/PPI::Token::HereDoc#heredoc

added test for the bug, also added additional test to extract_variables (just
to make sure our regexp deals with newlines right)