Restructuring and expansion of documentation. Also some backend cleanup.