Initial commit of major rewrite with other improvements. Basis added an authentication layer in order to access their API, which broke the prior version of this script.