Refactor code, split out maths to firemath.py, add arg parsing

Instead of doing all of the math in firemarshal, use a module to keep
thing separate. This way it can be re-used in other systems if need be.

Also added argument parsing using argparse.