Added nicer handling of non-DOM environments
1.0.3