changed headers and added some const correctness
Merge pull request #12 from R3AL/master

const + memory leak fixed