Add support for array elements in config

Refactored: Added Config class to handle the internal JSON structure