move non UI code out from file lister

more cleanup, move non-ui code out from file lister. Created a core
library, will move core code into that over time.