fixed_point now uses generic integer storage

This fixes many issues with overflows. The fixed point calculations now cast intermediate results to appropriate higher precision to eradicate overflows. E.g. adding two 24.8 fixed-point numbers involves the operation a.v * b.factor, which produces an intermediate result of 32+8=40 bits.

Also cleaned up the implementation a bit. Should be very straightforward to use now.