begin refactor
Fix broken function calls
Fix merge conflict
Fix event call issue
Fixed random id initialization issue + double initialization placement check
Merge pull request #150 from dave0783/master

Refactor of master