Added widgets directory, added flatten json method