Move registry scan back to main

Doing a scan elsewhere results in too many problems with scans
happening before all patterns are registered.