full implementation of ractive 0.4.0 (but without any tests)