Add weighted() support for fractional weight as suggested by @davmillar in #76