refactor: add licence, fully path all sys calls, detach database commands to new function
added files missing in refactor, updated file permissions