Added SELECT stuff, refactored code, ensured baseline functionality - at its core, everything should be working now.