Massive overhaul, minor bug fix in the works.