Events

Added basic events functions and threads