moved most things into 'lib' sub-directory to keep root directory cleaner