refactored define.py to add packet/message to module object, update magic sample