code cleanup: replace nulls with undefined
change folder structure, move all new formatting related bits to 'format' folder