Initial cleanup, added documentation to most frontend scripts