ks2d: Add fd.py and use rationals.