Refactor SQL parsing into own subroutine.
Refactor parseSecureInsertTags to use parseInsertTags instead of using Controller.
Fix notice: undefined index "aggregate".
Code cleanup, code style and phpDoc.
Bugfix: ensure we have an attribute before accessing it.
Introduce unit testing.
Fix issue #376 - CustomSQL: default value for request not parsed.