crazy optimizations, modularize code better

Some utilities were modularized, like creating a datapoint array and
pushing it onto the table on the back of the stack.
Indexes were added to the tables where needed, immensely improving
performance.
New GetDKey was created, which immediately inserts the result into a lua
table.
Allow the ability to get all relevant datapoints from a pattern, since
most people will be pulling the data for all matching patterns anyway
(this won't work if you plan on relying on partial matches).

Holy shit this needs proper documentation.  Trying to doxegenize this
code is going to be a serious pain in the ass.  Still can't figure out
how to properly create a user-side documentation.  Might have to do that
more manually.