Refactor populateLibrary

* Add files from top-level dir
* Recurse all subdirs
* Remove empty entries (dirs with no files)
* Remove trailing slash in init method
Cleanup trailing ws