[build] Split library into separate modules (core and layouts)