Clean up bin logstash

Moves functions/complexity into bin/logstash.lib.sh