Cleaned up lua script for tagtransform

Replaced lists of if-statements with tables over which to iterate

This was suggested in #53 by systemed