fix for bug #1 and various improvements

Fixed datetime issue.
Added query related features function.
Added better table support.