adds trace.on option for opt-in for tracing

refactors array.filter, array.every and array.some to for-loops