improve script filters and gt select

This pull request allows to access external files from a Lua script filter. It also adds `-retainids` to the `gt select` tool.