Improve performance of messageListHelper.init function

Instead of iterating over the object's properties using for...in, we can
convert the object to an array using Object.keys and then iterate over it
using a normal for loop.