Work on API

Added square and cube functions, updated docs. This took a really long
time due to unexpected issues.