Cleanups, moved masks to common file, changed event code import to be relative