Modules and LD filter

Separated out the routines into modules, and added LD filter mode -
requires revised database.

Need to finish the install