Libstar

there (most likely) be dragons here!
i can split into individual patches if needed