Improved guide

Generally improved the guide by adding more references to external
documentation, more explanation on the code, and removing typos.