Port of http://wordpress.org/plugins/really-static/