more work on module manager
cleanups to misc functions and include.php