Added database connection, tweaking edge cases

Repaired some limiter problems and regex problems, still needs a bit
more work.