Split the architecture-finding code into its own module

Add some tests while at it
Don't limit the number of links in demo mode