Extract page_size method. Introduce debug_print macro with Makefile target selection.