Add filtering of instances by security group id

See issue #276.