break out directives, move app config to public
improve JSON import