Started refactor of casting table

Still need to work out the kinks.