Whitespace removal fix (issue #81)

Just added the suggested RE's. (dont think we need any sub to trim whitespace)
Maybe we can simplify it as 

```perl
$query =~ s/^\s+|\s+$//g;
```

What do you think? Thanks for doing this, BTW! (☞ﾟヮﾟ)☞