Some quick tidying up of the code, and initial attempts at adding in the skeletal tracking stuff. This file will soon be abstracted into another folder.

Signed-off-by: Lim Mingjie Kenneth <kenlimmj@gmail.com>