refactors link-building code
adds working page selector prototype