First major update

Warning: Use with caution (untested code)