Initial table detection working, needs cleanup though (just hacked together right now, needs own module