Added djb2 hash. More scriptmanager design, starting support for multiple states/threads