Interval Algebra - Composition - Near Completion, also updated BayesNet's network.py

Decomposition problem is fully solved by non-linear least squares.
Tried to use the same approach for composition, but NLLS failed due to getting stuck at local optimas.
A DFS should be able to solve the composition problem, conceptually. Implemented the "rails framework" (a data structure invented by myself and @rekino) to facilitate the DFS.

This PR also fixes an issue @mb3152 was encountering in the old BayesNet code. I realise that this code hasn't really been maintained ever since I wrote it, but I'm taking a per-request approach as my personal objectives have diverged drastically from BayesNet stuff. A very welcome addition is to use NetworkX as backend instead of the current in-house solution. @mb3152 might be willing to take a stab at this...