cleanup and renames

Library now contains all the globals. I hope this isn’t the wrong move.