Modular construction for the programmed assembly of molecular crystals and liquid crystals