works on top of libScarab

quite a header mess so far (copied headers from the libScarab project)