More helper functions

margins now work, as do margin events